<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<title>活期存款计算器</title>
<link href="base.css" rel="stylesheet" type="text/css">
<link href="tool.css" rel="stylesheet" type="text/css">
<link href="art.default.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="base.js"></script>
<script type="text/javascript" src="artDialog.basic.js"></script>
<script type="text/javascript">

function hqsumcalc(){


	var hqSaveSum = $id('hqSaveSum');
	var hqFullRate = $id('hqFullRate');
	var hqDate = $id('hqDate');
	var hqFullSum = $id("hqFullSum");
	
	
	if( !checkFormPlus(hqSaveSum, "存入金额")){ return false; }

	if( !checkFormPlus(hqFullRate, "年利率")){ return false; }

	if( !checkFormPlus(hqDate,"存储期限")){ return false }
	

    SaveInSum = parseInt(hqSaveSum.value);

    YearRate = parseFloat( hqFullRate.value );

    //var diffday =  parseInt(parseFloat(hqDate.value) * 30);
	var diffday = parseFloat(hqDate.value);
	var taxrate=0.00;//Saving Tax Rate,20090210
    var result=SaveInSum*(1+(1-taxrate)*YearRate*diffday*0.01/12) 

	result=(result * 100).format(2);
	result=result/100 
	
    hqFullSum.value= result.format(2);

}

//form reset

function frmReset(formObj){

    formObj.reset();

    $id("hqbeginDate").value = today();

	var tomorrowDate = new Date();
	
	tomorrowDate.setTime(strToDate( today()));
	
 	addday(tomorrowDate,1)
		
    $id("hqendDate").value = dateToStr(tomorrowDate);

}

window.onload = function(){
	frmReset( $id('formact') );
		
}

</script>

</head>
<body>
<div class="container" id="container">
  <form action="" method="post" id="formact" onSubmit="return false;">
  <div class="title">
    <h2>活期存款计算器</h2>
    <div class="bg"></div>
  </div>
  <div class="content">
      
      <div class="warm_tip">
      	<p>活期存款计算器可以帮您计算活期储蓄的本息额
        </p>
      </div> 
    	
      <ul class="form_items">
        <li>
          <label>存入金额:</label>
          <span>
          <input type="text" name="hqSaveSum" id="hqSaveSum" value=""/>
          元</span> </li>
        <li>
          <label>年利率:</label>
          <span>
          <input type="text" name="hqFullRate" id="hqFullRate" value="0.50"/>
          %</span> </li>
        <li>
          <label>存储期限:</label>
          <span>
          <input type="text" name="hqDate" id="hqDate"/> 月
          </span> </li>
      </ul>
      <div class="button_bar">
        <input type="button" onClick="hqsumcalc();" value="开始计算" class="submit" />
        <input type="button" id="hqResetBtn" class="reset" value="重新计算" onClick="frmReset(this.form)"/>
      </div>
   
  </div>
  <div class="title">
    <h2>计算结果</h2>
    <div class="bg"></div>
  </div>
  <div class="content">
    <ul class="form_items">
      <li>
        <label>实得本息总额：</label>
        <span>
        <input type="text" name="hqFullSum" id="hqFullSum" value="" readonly="readonly" disabled="true" role="disabled"/>
        </span> </li>
    </ul>
  </div>
  </form>
</div>
</body>
</html>
